<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .axis-container {
            position: relative;
            height: 200px;
            /* 添加容器高度 */
        }

        .axis-container:before {
            content: '';
            display: block;
            position: absolute;
            top: calc(50% - 1px);
            left: 0;
            width: 100%;
            height: 2px;
            background-color: #333;
        }

        .axis-x {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 1px;
            background-color: #333;
            transform: translateY(50%); /* 添加transform属性 */
        }

        .axis-y {
            position: absolute;
            top: 0;
            right: 0;
            width: 1px;
            height: 100%;
            background-color: #333;
            transform: translateX(50%); /* 添加transform属性 */
        }
    </style>
</head>

<body>
    <div class="axis-container">
        <div class="axis-x"></div>
        <div class="axis-y"></div>
    </div>
</body>

</html>